package ro.pub.cs.client.settings;

import ro.pub.cs.client.data.Homework;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class HomeworkSettings extends Composite implements ClickListener {
	private VerticalPanel layoutPanel = new VerticalPanel();
	private Button addButton = new Button("Add New Homework...");
	
	public HomeworkSettings() {
		addButton.addClickListener(this);
		
		layoutPanel.add(new HomeworkItem(new Homework("", "Homework 1")));
		layoutPanel.add(new HomeworkItem(new Homework("", "Homework 2")));
		layoutPanel.add(new HomeworkItem(new Homework("", "Homework 3")));
		layoutPanel.add(new HomeworkItem(new Homework("", "Homework 4")));
		layoutPanel.add(new HomeworkItem(new Homework("", "Homework 5")));
		layoutPanel.add(addButton);
		
		initWidget(layoutPanel);
	}

	public void onClick(Widget sender) {
		if (sender == addButton) {
			EditHomeworkDialog editHwDlg = new EditHomeworkDialog();
			
			editHwDlg.show();
		}
		
	}
}
